package lab02.test25;

import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * Created by dell on 2017/11/5.
 */
public class Test {
    public static void main(String[] args) {
        int num1 = 0;
        int num2 = 0;
        Scanner scanner = new Scanner(System.in);

        try {
            System.out.println("请输入除数:");
            num1 = scanner.nextInt();

            System.out.println("请输入被除数:");
            num2 = scanner.nextInt();

        }catch (ArithmeticException e){
            System.out.println("输入的类型不合法");
        } catch (Exception e) {

        }

        if(num2 == 0) {
            System.out.println("除数为0！！！");
        } else {
            System.out.println(num1 + " / " + num2 + " = " + (num1 / num2));
        }
    }
}
